package org.sgx.gwtjsutiltest.client;

import org.sgx.jsutil.client.JsRegExp;
import org.sgx.jsutil.client.JsUtil;
import org.sgx.jsutil.client.TestUtil;

import com.google.gwt.core.client.JsArrayString;
import com.google.gwt.user.client.Window;

public class JsRegexTest1 {
public void test1(TestUtil test) {
	
	//example: 
//	var str="Hello world!";
//	//look for "Hello"
//	var patt=/Hello/g;
//	var result=patt.exec(str);
	
	String str = "Hello world!"; 	
	JsRegExp patt = JsRegExp.create("Hello", "g");
	JsArrayString result = patt.exec(str);
	test.assertTrue(result.length()==1&&result.get(0).equals("Hello"), "JsRegexTest1_exec1"); 
}
}
